/**
 *基酒
 */
import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    ListView,
    Image,
    TouchableOpacity,
    Platform,
    AsyncStorage,
    ScrollView,
    Navigator,
    InteractionManager,
} from 'react-native';
var NavigatorBar = require('../Main/NXNavigationBar'); //NavigationBar
var Dimensions = require('Dimensions'); //Dimensions
var screenWidth = Dimensions.get('window').width; //屏宽
var CommentCell = require('./BaseCommentCell');//封装的Cell
var BaseDetail = require('./BaseDetail');//详情界面
import XPRecord from '../Mine/XPRecord';//我的询盘
import APP from '../App';//首页”
import Home from '../Home/Home';//首页”
var BaseInquirySuccess = React.createClass({
    render() {
        return (
            <View style={styles.container}>
                <NavigatorBar title='询盘成功' widthWH={Platform.OS == 'ios' ? 25:25} leftBtnName = 'back' rightBtnName = 'Share_icon' leftpress={()=>this.leftAction()} rightPress={()=>this.rightAction()} />
                {/*提示信息*/}
                <View style={styles.contentStyle}>
                    <Image source={require('../image/supply.png')}/>
                    <Text style={{fontSize:20}}>
                        您的信息已经提交成功,客服会联系您,请耐心等待!
                    </Text>
                </View>
                <View style={styles.bottomStyle}>
                    {/*查看我的询盘*/}
                    <TouchableOpacity onPress={()=>this.myInpuiryAction()}>
                        <View style={styles.leftStyle}>
                            <Text style={{fontSize:20,color:'white',marginTop:12}}>
                                查看我的询盘
                            </Text>
                        </View>
                    </TouchableOpacity>
                    {/*返回首页*/}
                    <TouchableOpacity onPress={()=>this.homeAction()}>
                        <View style={styles.rightStyle}>
                            <Text style={{fontSize:20,color:'white',marginTop:12}}>
                                返回首页
                            </Text>
                        </View>
                    </TouchableOpacity>
                </View>
            </View>
        );
    },
    //返回
    leftAction(){
        this.props.navigator.pop({

        });
    },
    //我的询盘
    myInpuiryAction(){
        this.props.navigator.pop({
            component:XPRecord
        });
    },
    //首页
    homeAction(){
        InteractionManager.runAfterInteractions()
        {
            // this.props.navigator.push({
            //     component : APP,
                
            
            // }) 
            this.props.navigator.immediatelyResetRouteStack(
                [{
                component: APP,
                }]
            );
            // this.props.selectHome();
        }
    },
});


var styles = StyleSheet.create({
    //最底层的View
    container: {
        flex: 1,
        backgroundColor: '#F5FCFF',
    },
    //提示信息
    contentStyle:{
        marginTop:100,
        alignItems:'center',
    },
    //包含两个按钮的view
    bottomStyle:{
        flexDirection:'row',
        marginTop:10,
        width:screenWidth,
        height:44,
        justifyContent:'space-around'
    },
    //查看我的询盘
    leftStyle:{
        height:44,
        width:screenWidth/3,
        marginLeft:10,
        backgroundColor:'gray',
        alignItems:'center',
    },
    //返回首页
    rightStyle:{
        height:44,
        width:screenWidth/3,
        marginRight:10,
        backgroundColor:'blue',
        alignItems:'center',
    },

});

module.exports = BaseInquirySuccess;
